package com.lijun.SpringBootJavaFX.service.serviceImpl.person;

import com.lijun.SpringBootJavaFX.model.person.People;
import com.lijun.SpringBootJavaFX.service.person.PersonService;
import org.springframework.stereotype.Service;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

@Service
public class PersonServiceImpl implements PersonService {
    @Override
    public String savePerson(People people) {
//        if (people.isEat()) {
//            people.eatProperty().getName();
//        }
        System.out.println(people.toString());
        return null;
    }

    @Override
    public People loadPerson(String id) throws ParseException {
        People people = new People();
        people.setInterestNames("阅读,美容,玩手机,射箭");
        people.setInterestCodes("1,5,13,24");
        people.setGenderName("男");
        people.setGenderValue("1");
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        Date birthday = sdf.parse("1999-01-22");
        people.setBirthday(birthday);
        people.setName("张三");
        people.setDetail("啦啦啦啦啦啦啦啦啦啦啦啦啦啦啦");
        people.setEduCode("2");
        people.setEduName("本科");

        return people;
    }
}
